package svc

import (
	"github.com/zeromicro/go-zero/core/stores/sqlx"
	"mall/app/member/cmd/rpc/internal/config"
	"mall/app/member/model"
)

type ServiceContext struct {
	Config      config.Config
	MemberModel model.UmsMemberModel
}

func NewServiceContext(c config.Config) *ServiceContext {
	conn := sqlx.NewMysql(c.DataSource)
	return &ServiceContext{
		Config:      c,
		MemberModel: model.NewUmsMemberModel(conn),
	}
}
